﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Collections;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;


public partial class ServicesSheet_BusinessCardList : System.Web.UI.Page
{
    private Srvtools.WebDataSet WMaster;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitializeComponent();

            Master.DataSource = WMaster;
          
            MasterPage_MasterPage master = (MasterPage_MasterPage)this.Page.Master;
            master.HelpHref = "~/Help/ServicesSheet/名片申请列表.htm";
            master.PageName = "名片申请列表";
            master.PicUrl = "";
            master.IntiBar();
        }

    }

    private void InitializeComponent()
    {
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServicesSheet_BusinessCardList));
        this.WMaster = new Srvtools.WebDataSet();
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).BeginInit();
        // 
        // WMaster
        // 
        this.WMaster.Active = true;
        this.WMaster.AlwaysClose = false;
        this.WMaster.DataCompressed = false;
        this.WMaster.DeleteIncomplete = true;
        this.WMaster.Guid = null;
        this.WMaster.LastKeyValues = null;
        this.WMaster.Locale = new System.Globalization.CultureInfo("zh-CN");
        this.WMaster.PacketRecords = 100;
        this.WMaster.Position = -1;
        this.WMaster.RemoteName = "ServiceSheet.List_BusCard";
        this.WMaster.ServerModify = true;
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).EndInit();

    }

   
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        string Sql = "(1=1)";
      
        string strEmpId = SelUser.EmpName;
        if (strEmpId != "" && strEmpId != string.Empty) Sql = Sql + " And (Employees.EmpName like '%" + strEmpId + "%') ";
        if (QPrinted.SelectedValue != "9") Sql = Sql + " And (Services_BusinessCard.Printed =" + QPrinted.SelectedValue + ")";
        if (QGiven.SelectedValue != "9") Sql = Sql + " And (Services_BusinessCard.Given = " + QGiven.SelectedValue + ")";
        Master.SetWhere(Sql);

        Master.DataBind();
        wgvMaster.DataBind();
    }

    //protected void btnClear_Click(object sender, EventArgs e)
    //{

    //    this.QueryEmp.BindingValue = "";
    //    this.QueryEmp.BindingText = "";
    //    QPrinted.SelectedValue = "9";
    //    QGiven.SelectedValue = "9";
    //    string Sql = "(1=1)";
    //    Master.SetWhere(Sql);
    //    Master.DataBind();
    //    wgvMaster.DataBind();
    //}
   
}
